#include <stdio.h>

int main() {
    int a = 10, b = 20, sum;
    __asm__ __volatile__(
        "movl %1, %%eax;"
        "addl %2, %%eax;"
        "movl %%eax, %0;"
        :"=r"(sum)
        :"r"(a), "r"(b)
        :"%eax"
    );
    printf("sum=%d\n", sum);
    return 0;
}
